﻿#pragma once

#include <QThread>
#include <QTcpServer>
#include "server_base.h"

class ServerQt : public QObject, public ServerBase {
    Q_OBJECT

public:
    ServerQt(QObject* parent = nullptr);
    ~ServerQt();
    virtual void Start() override;
    virtual void Stop() override;
    virtual void Wait() override;
    virtual unsigned short Port() const override;

private:
    QTcpServer server_;
    QThread thread_;

private slots:
    void OnNewConnection();
    void OnReadyRead();

};
